#ifndef I2CDRIVER_H_
#define I2CDRIVER_H_

#include "..\System\F2806x_Device.h"

class I2CDriver
{
public:
	bool InitI2C();
	bool ReadReg16(Uint16 address, Uint16* data);
	bool ReadReg24(Uint16 address, Uint32* data);
	bool ReadReg48Swapped(Uint16 startAddress, Uint16* data);
	bool ReadReg48(Uint16 startAddress, Uint16* data);
	bool WriteReg8(Uint16 address, Uint16 data);

	bool Read4Bytes(Uint32* data);

private:
	bool WaitTransferDone(Uint16 codeToWait);
	
protected:
	Uint16 m_SAR;
};

#endif /*I2CDRIVER_H_*/
